bitkeeper revision 1.1159.1.122 (41384ddcEDLEgoHoCYQuvXnUiQgwcw)
authorcl349@freefall.cl.cam.ac.uk <cl349@freefall.cl.cam.ac.uk>
Fri, 3 Sep 2004 10:56:28 +0000 (10:56 +0000)
committercl349@freefall.cl.cam.ac.uk <cl349@freefall.cl.cam.ac.uk>
Fri, 3 Sep 2004 10:56:28 +0000 (10:56 +0000)
Allow loading other images besides Linux images.

tools/libxc/xc_linux_build.c
xen/common/elf.c

index 41569b80577ebd8efeba8f4091b69c38362df072..ea504c12e80a8f5f1288ae521cd6ce5648f73bc7 100644 (file)
@@ -600,10 +600,18 @@ static int parseelfimage(char *elfbase,
 
         guestinfo = elfbase + shdr->sh_offset;
 
-        if ( (strstr(guestinfo, "GUEST_OS=linux") == NULL) ||
-             (strstr(guestinfo, "XEN_VER=2.0") == NULL) )
+        if ( (strstr(guestinfo, "LOADER=generic") == NULL) &&
+             (strstr(guestinfo, "GUEST_OS=linux") == NULL) )
         {
-            ERROR("Will only load Linux images built for Xen v2.0");
+            ERROR("Will only load images built for the generic loader "
+                  "or Linux images");
+            ERROR("Actually saw: '%s'", guestinfo);
+            return -EINVAL;
+        }
+
+        if ( (strstr(guestinfo, "XEN_VER=2.0") == NULL) )
+        {
+            ERROR("Will only load images built for Xen v2.0");
             ERROR("Actually saw: '%s'", guestinfo);
             return -EINVAL;
         }
index 1d8384e3bd1dfa65c276bcac651da7755fde51d4..ae20c04f6f348a36960298c5340326f92fd1d200 100644 (file)
@@ -68,10 +68,17 @@ int parseelfimage(char *elfbase,
         guestinfo = elfbase + shdr->sh_offset;
         printk("Xen-ELF header found: '%s'\n", guestinfo);
 
-        if ( (strstr(guestinfo, "GUEST_OS=linux") == NULL) ||
-             (strstr(guestinfo, "XEN_VER=2.0") == NULL) )
+        if ( (strstr(guestinfo, "LOADER=generic") == NULL) &&
+             (strstr(guestinfo, "GUEST_OS=linux") == NULL) )
         {
-            printk("ERROR: Xen will only load Linux built for Xen v2.0\n");
+            printk("ERROR: Xen will only load images built for the generic "
+                   "loader or Linux images\n");
+            return -EINVAL;
+        }
+
+        if ( (strstr(guestinfo, "XEN_VER=2.0") == NULL) )
+        {
+            printk("ERROR: Xen will only load images built for Xen v2.0\n");
             return -EINVAL;
         }